//Class to handle the direct input calls

#ifndef DIRECTINPUT_H
#define DIRECTINPUT_H

#define DIRECTINPUT_VERSION 0x0800

#pragma comment(lib, "dinput8.lib")
#pragma comment(lib, "dxguid.lib")

#include <dinput.h>
#include "Singleton.h"
#include "NonCopyable.h"

class DirectInput : public NonCopyable
{
public:
	~DirectInput();

	bool InitKeyboard();
	bool InitMouse();

	void Update();
	bool KeyDown(int key);
	bool KeyUp(int key);
	bool KeyPressed(int key);

	bool MouseButtonDown(int button);
	float MouseDX();
	float MouseDY();
	float MouseDZ();

private:
	DirectInput();
	friend class Singleton<DirectInput>;

private:
	IDirectInput8* m_DInput; 
	IDirectInputDevice8* m_Keyboard; // Interface to the Input Device
	char m_KeyboardState[256];
	int m_KeyState[256];

	IDirectInputDevice8* m_Mouse;
	DIMOUSESTATE2        m_MouseState;
};
typedef Singleton<DirectInput> TheInputDevice;

#endif